package com.lovo.dao;

import com.lovo.bean.StudentBean;
import com.lovo.bean.UserBean;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import java.util.List;

public interface IUserDAO extends JpaRepository<UserBean,String> {
    UserBean findByUsernameAndPwd(String username,String pwd);
//    @Query("from UserBean where username=?1 and pwd=?2")
    @Query("from UserBean where username=:username and pwd=:pwd")
//    @Query(value = "select * from user_info where user_name=:username and user_pass=:pwd",nativeQuery = true)
    List findCondition(@Param("username") String username, @Param("pwd") String pwd);
    @Modifying
    @Query("update UserBean set pwd=?2 where id=?1")
    void update(String id,String pwd);
}
